#ifndef MSDRM_H
#define MSDRM_H
#include <libmslog/mstype.h>

typedef int (*DODatafunc)(void *,unsigned char *,unsigned char *, int *);
typedef struct DODrm{
	const char *name;
	const char *longname;
	void *(*init)(void );
	void (*setopt)(void *,unsigned char);
	void (*setkey)(void *,unsigned char *, int);
	int (*enc)(void *,unsigned char *,unsigned char *, int *);
	int (*dec)(void *,unsigned char *,unsigned char *, int *);
	void (*deinit)(void *);
	struct DODrm *next;
}DODrm;
	
typedef enum{
	msdrm_em_unkonw	=0x00,
	msdrm_em_aes_ecb,
	msdrm_em_aes_cbc,
}MSENU_DRMENCmethod;

/*
VAL OPT:
	[0:1]MSENU_DRMENCmethod
*/
#define msdrm_emopt_mask_entype 			0x3
#define msdrm_emopt_mask_dataenc			(1<<2)

#define msstring_drmaes	"drmaes"
#ifndef MSDRM_C

extern int 
	msdrm_api_register(DODrm *table, int size);
extern void * 
	msdrm_api_match(const char *);


extern ms_s08  
	msdrm_oneapi_ptlinit(ms_u08 * ms_in urlin,ms_u08 * ms_in urlout,ms_u08 * ms_in key,ms_s32 ms_in len);
extern ms_void 
	msdrm_oneapi_ptldeinit(ms_void);
extern ms_void  
	msdrm_api_infofunc(ms_string ms_out pbuf);
extern ms_string 
	msdrm_api_version(ms_void);
#endif
#endif
